package com.feiyumall.account.controller;

import com.feiyu.common.utils.R;
import com.feiyumall.account.dto.userManagerDto;
import com.feiyumall.account.service.userService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: Doate
 * @Date: Created in 2021/4/14 22:35
 * @Description:
 */

@RestController
public class UserManagerController {

    @Resource
    userService userService;

    @PostMapping("/searchByParam")
    public R searchByParam(@RequestBody userManagerDto dto) {

        Map<String,Object> data = userService.selectByParam(dto);
        return R.ok().put("data",data);
    }

    @PostMapping("/searchById")
    public R searchById(@RequestBody userManagerDto dto) {

        return R.ok().put("data",userService.searchById(dto.getUserId()));
    }


}
